package com.speakglobe.panelist.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * Parent Entity class for E-Wallet which has wallet_type column 
 * which will be automatically differentiate child entities by the DiscriminatorColumn.
 * 
 * @author ronnie
 *
 */
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "wallet_type", discriminatorType = DiscriminatorType.STRING)
@Table (name = "e_wallet")
public class EWallet implements Serializable {
	
	private static final long serialVersionUID = 6554904325323401L;
	
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
	
	@OneToMany(mappedBy="eWallet")
	private Set<Statement> statements;
	
	private Double balance;
	
	@OneToOne
	@JoinColumn(name = "panelist_id")
	private Panelist panelist;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Set<Statement> getStatements() {
		return statements;
	}

	public void setStatements(Set<Statement> statements) {
		this.statements = statements;
	}

	public Double getBalance() {
		return balance;
	}

	public void setBalance(Double balance) {
		this.balance = balance;
	}

	public Panelist getPanelist() {
		return panelist;
	}

	public void setPanelist(Panelist panelist) {
		this.panelist = panelist;
	}
	
}
